/**
 * Copyright (c) 2025 Huawei Technologies Co., Ltd.
 * This program is free software, you can redistribute it and/or modify it under the terms and conditions of
 * CANN Open Software License Agreement Version 2.0 (the "License").
 * Please refer to the License for details. You may not use this file except in compliance with the License.
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
 * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
 * See LICENSE in the root of the software repository for the full text of the License.
 */

#ifndef HCCL_INDEPENDENT_COMMON_H
#define HCCL_INDEPENDENT_COMMON_H

#include "hccl_api.h"
#include "hccl_common.h"
#ifdef __cplusplus
extern "C" {
#endif  // __cplusplus
constexpr u32 NOTIFY_MAX_NUM = 2048;
inline bool IsValidCommEngine(CommEngine engine)
{
    switch (engine) {
        case COMM_ENGINE_HOSTCPU:
        case COMM_ENGINE_HOSTCPU_TS:
        case COMM_ENGINE_AICPU:
        case COMM_ENGINE_AICPU_TS:
        case COMM_ENGINE_AIV:
        case COMM_ENGINE_CCU:
            return true;
        default:
            return false;
    }
}

inline bool IsValidNotify(NotifyType notifyType)
{
    switch (notifyType) {
        case NOTIFY_TYPE_RESERVED:
        case NOTIFY_TYPE_RTS_NOTIFY:
        case NOTIFY_TYPE_RTS_EVENT:
        case NOTIFY_TYPE_DEVICE_MEM:
            return true;
        default:
            return false;
    }
}

#ifdef __cplusplus
}
#endif  // __cplusplus


#endif